package com.ruoyi.business.domain;

import com.ruoyi.common.utils.DateUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 兑现申请记录对象 biz_cash_info
 *
 * @author ruoyi
 * @date 2020-09-23
 */
public class BizCashInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    //提现申请状态
    public static final int CASH_INFO_STATUS_INITIAL = 0;
    public static final int CASH_INFO_STATUS_AGREE = 1;
    public static final int CASH_INFO_STATUS_DENY = 2;

    /** 兑现申请ID */
    private Long id;

    /** 会员ID */
    private Long memberId;

    /** 会员姓名 */
    @Excel(name = "会员姓名")
    private String memberName;

    /** 会员账户ID */
    private Long accountId;

    /** 账户类型 */
    private Integer accountType;

    /** 账户类型 */
    @Excel(name = "账户类型")
    private String accountTypeName;

    /** 开户银行 */
    private Integer bankId;

    /** 开户银行 */
    @Excel(name = "开户银行")
    private String bankName;

    /** 开户人 */
    @Excel(name = "开户人")
    private String bankUser;

    /** 开户地 */
    @Excel(name = "开户地")
    private String bankCity;

    /** 卡号 */
    @Excel(name = "卡号")
    private String bankCard;

    /** 提现金额 */
    @Excel(name = "提现金额")
    private Integer drawMoney;

    /** 税后金额 */
    @Excel(name = "税后金额")
    private Double drawMoneyFinal;

    @Excel(name = "申请时间")
    private String createTimeStr;

    /** 0-默认 1-通过 2-驳回 */
    @Excel(name = "0-默认 1-通过 2-驳回")
    private Integer status;

    private String startTime;

    private String endTime;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setMemberId(Long memberId)
    {
        this.memberId = memberId;
    }

    public Long getMemberId()
    {
        return memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public void setAccountId(Long accountId)
    {
        this.accountId = accountId;
    }

    public Long getAccountId()
    {
        return accountId;
    }
    public void setAccountType(Integer accountType)
    {
        this.accountType = accountType;
        String accountTypeName = "";
        switch (accountType)
        {
            case BizAccount.DOU_PERSON:accountTypeName = "个人福豆";break;
            case BizAccount.DOU_TEAM:accountTypeName = "团队福豆";break;
            case BizAccount.DOU_FIELD:accountTypeName = "福豆田";break;
        }
        setAccountTypeName(accountTypeName);
    }

    public Integer getAccountType()
    {
        return accountType;
    }
    public void setBankId(Integer bankId)
    {
        this.bankId = bankId;
        setBankName(getBN(bankId));
    }

    public String getBN(Integer bankId)
    {
        if (bankId == null) return "";
        switch (bankId)
        {
            case 1: return "工商银行";
            case 2: return "交通银行";
            case 3: return "农业银行";
            case 4: return "建设银行";
            case 5: return "中国银行";
            case 6: return "招商银行";
            case 7: return "邮政储蓄银行";
        }
        return "";
    }

    public Integer getBankId()
    {
        return bankId;
    }
    public void setBankUser(String bankUser)
    {
        this.bankUser = bankUser;
    }

    public String getBankUser()
    {
        return bankUser;
    }
    public void setBankCity(String bankCity)
    {
        this.bankCity = bankCity;
    }

    public String getBankCity()
    {
        return bankCity;
    }
    public void setBankCard(String bankCard)
    {
        this.bankCard = bankCard;
    }

    public String getBankCard()
    {
        return bankCard;
    }
    public void setDrawMoney(Integer drawMoney)
    {
        this.drawMoney = drawMoney;
        if (drawMoney != null) {
            setDrawMoneyFinal(drawMoney * 0.95);
        }
    }

    public Integer getDrawMoney()
    {
        return drawMoney;
    }
    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getAccountTypeName() {
        return accountTypeName;
    }

    public void setAccountTypeName(String accountTypeName) {
        this.accountTypeName = accountTypeName;
    }

    public Double getDrawMoneyFinal() {
        return drawMoneyFinal;
    }

    public void setDrawMoneyFinal(Double drawMoneyFinal) {
        this.drawMoneyFinal = drawMoneyFinal;
    }

    public void setCreateTime(Date createTime)
    {
        super.setCreateTime(createTime);
        createTimeStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, createTime);
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("memberId", getMemberId())
                .append("accountId", getAccountId())
                .append("accountType", getAccountType())
                .append("bankId", getBankId())
                .append("bankUser", getBankUser())
                .append("bankCity", getBankCity())
                .append("bankCard", getBankCard())
                .append("drawMoney", getDrawMoney())
                .append("status", getStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
